//
// Created by THE13 on 2024/2/5.
//

#ifndef CHICHIBOOM_UI_SIMLATOR_DRIVER_INTERFACE_H
#define CHICHIBOOM_UI_SIMLATOR_DRIVER_INTERFACE_H

#include <stdint.h>
#include <stdbool.h>

#include "sdl2_interface.h"
#include "st7789.h"

typedef struct _SDL2_{
	void (*init)(void);
	void (*setPencilMode)(uint8_t mode ,int drawColor,int bgColor);
	void (*setFont)(FontDefv2 font);
	/*2.draw string*/
	void (*drawFloat)(int16_t x, int16_t y, float num);
	void (*drawString)(int16_t x, int16_t y, const char *str);
	void (*drawCN)(int16_t x, int16_t y,FontDefv2 font);
	/*3.draw box*/
	void (*drawBox)(int16_t x, int16_t y, uint16_t w, uint16_t h);
	void (*drawBoxBg)(int16_t x, int16_t y, uint16_t w, uint16_t h);
	/*4.draw Rbox*/
	void (*drawRBox)(int16_t x, int16_t y, uint16_t w, uint16_t h,uint16_t r);
	/*5.draw frame*/
	void (*drawFrame)(int16_t x, int16_t y, uint16_t w, uint16_t h);
	/*6.draw Rframe*/
	void (*drawRFrame)(int16_t x, int16_t y, uint16_t w, uint16_t h,uint16_t r);
	/*7.draw h line*/
	void (*drawHLine)(int16_t x, int16_t y, uint16_t len);
	/*6.draw v line*/
	void (*drawVLine)(int16_t x, int16_t y, uint16_t len);
	/*7.draw  line*/
	void (*drawLine)(int16_t x0, int16_t y0, int16_t x1, int16_t y1);
	/*8.draw  circle*/
	void (*drawCircle)(int16_t x, int16_t y, uint16_t rad, uint8_t option);
	/*9.draw  disc*/
	void (*drawDisc)(int16_t x, int16_t y, uint16_t rad, uint8_t option);
	/*10.draw  image*/
	void (*drawImage)(int16_t x, int16_t y, int16_t w, int16_t h, const uint16_t *data);
	/*11.set  pixel*/
	void (*setPixel)(int16_t x, int16_t y);
	/*end.send buff*/
	void (*sendBuff)(void);
	/*end.clean buff*/
	void (*cleanBuff)(void);
}_SDL2_t;

extern _SDL2_t SDL2;

/*0.init*/
void SDL2_init(void);
/*1.set pencil mode*/
void SDL2_setPencilMode(uint8_t mode ,int drawColor,int bgColor);
/*2.draw string*/
void SDL2_setFont(FontDefv2 font);
void SDL2_drawFloat(int16_t x, int16_t y, float num);
void SDL2_drawString(int16_t x, int16_t y, const char *str);

void SDL2_drawCN(int16_t x, int16_t y,FontDefv2 font);
/*3.draw box*/
void SDL2_drawBox(int16_t x, int16_t y, uint16_t w, uint16_t h);
/*4.draw Rbox*/
void SDL2_drawRBox(int16_t x, int16_t y, uint16_t w, uint16_t h,uint16_t r);
void SDL2_drawBoxBg(int16_t x, int16_t y, uint16_t w, uint16_t h);
/*5.draw frame*/
void SDL2_drawFrame(int16_t x, int16_t y, uint16_t w, uint16_t h);
/*6.draw Rframe*/
void SDL2_drawRFrame(int16_t x, int16_t y, uint16_t w, uint16_t h,uint16_t r);
/*7.draw h line*/
void SDL2_drawHLine(int16_t x, int16_t y, uint16_t len);
/*6.draw v line*/
void SDL2_drawVLine(int16_t x, int16_t y, uint16_t len);
/*7.draw  line*/
void SDL2_drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1);
/*8.draw  circle*/
void SDL2_drawCircle(int16_t x, int16_t y, uint16_t rad, uint8_t option);
/*9.draw  disc*/
void SDL2_drawDisc(int16_t x, int16_t y, uint16_t rad, uint8_t option);
/*10.draw  image*/
void SDL2_drawImage(int16_t x, int16_t y, int16_t w, int16_t h, const uint16_t *data);
/*11.set  pixel*/
void SDL2_setPixel(int16_t x, int16_t y);
/*end.send buff*/
void SDL2_sendBuff(void);
/*end.clean buff*/
void SDL2_cleanBuff(void);
#endif //CHICHIBOOM_UI_SIMLATOR_DRIVER_INTERFACE_H
